import { observable, action } from 'mobx';
import BaseListStore from '../BaseListStore';
import * as Apis from '../../apis/ReportApi';

class ReportDetailStore extends BaseListStore {
  constructor() {
    super();
    this.viewTop = false;
  }

  getTableData(requestParams, callBackFn) {
    const type = this.routerParams.type;
    const newParams = { ...requestParams, ...this.routerParams };
    delete newParams.type;
    Apis.getContractReport(type, newParams).then((data) => {
      callBackFn(data);
    });
  }

  excelExport(excelExportCallBack) {
    const type = this.routerParams.type;
    const requestParams = {};
    Apis.getContractReportExcel(type, requestParams).then((data) => {
      excelExportCallBack(data);
    });
  }
}

export default ReportDetailStore;
